From: Bill Wohler Date: Wed, 11 Jul 2007 05:58:31 +0000 (+0000) Subject: (mh-display-color-cells): Fix on XEmacs 21.5b28. Thanks to Henrique X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~17985 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=cd42c249f25b2f78f5a999b56d8d9ed8747c28a9;p=emacs.git (mh-display-color-cells): Fix on XEmacs 21.5b28. Thanks to Henrique Martins for the help (closes SF #1749774). --- diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 2f57e1763ab..a1382a8298e 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el @@ -77,13 +77,17 @@ introduced in Emacs 22." 'cancel-timer 'delete-itimer)) -(defun-mh mh-display-color-cells display-color-cells (&optional display) +(defun mh-display-color-cells (&optional display) "Return the number of color cells supported by DISPLAY. -This function is used by XEmacs to return 2 when -`device-color-cells' returns nil. This happens when compiling or +This function is used by XEmacs to return 2 when `device-color-cells' +or `display-color-cells' returns nil. This happens when compiling or running on a tty and causes errors since `display-color-cells' is expected to return an integer." - (or (device-color-cells display) 2)) + (cond ((fboundp 'display-color-cells) ; GNU Emacs, XEmacs 21.5b28 + (or (display-color-cells display) 2)) + ((fboundp 'device-color-cells) ; XEmacs 21.4 + (or (device-color-cells display) 2)) + (t 2))) (defmacro mh-display-completion-list (completions &optional common-substring) "Display the list of COMPLETIONS.